package edu.biwu.utils;

import jakarta.servlet.http.Cookie;

//处理cookie的一个工具类
public class CookieUtils {
    private CookieUtils(){
        //这样不能new来造对象
    }

    public static Cookie getCookie(Cookie[] cookies,String name){
        if (cookies!=null){
            for (Cookie cookie : cookies) {
                if (cookie.getName().equals(name)){
                    return cookie;
                }
            }
        }
        return null;
    }
}
